﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views.popups.lostpet {
    import flash.events.*;
    import reprise.controls.*;
    import net.wooga.pets.events.*;
    import net.wooga.pets.models.*;
    import net.wooga.pets.views.popups.*;
    import net.wooga.pets.constants.*;
    import net.wooga.pets.utils.*;

    public class LostPetMediator extends AbstractPopupMediator {

        public var friendsModel:FriendsModel;
        public var userModel:UserModel;
        private var _sendAwayButton:LabelButton;
        private var _askFriendButton:LabelButton;

        override public function onRegister():void{
            super.onRegister();
            addLabel("title showcardGothicFont", "lost_cub_header");
            this._sendAwayButton = createButton(this.view, "blueButton sendAwayButton", "global_send_away", "myriadProFont");
            eventMap.mapListener(this._sendAwayButton, MouseEvent.CLICK, this.onSendAway);
            this._askFriendButton = createButton(this.view, "greenButton askFriendButton", "global_button_askfriends", "myriadProFont");
            eventMap.mapListener(this._askFriendButton, MouseEvent.CLICK, this.onAskFriend);
            RepriseUtils.addComponent(this.view, "lion");
            RepriseUtils.addLabel(this.view, "myriadProFontNormal description", language.getTextByKey("lost_cub_description"));
        }
        private function onSendAway(_arg1:MouseEvent):void{
            close();
        }
        private function onAskFriend(_arg1:MouseEvent):void{
            close();
            var _local2:Object = {request_type:"lost_pet", is_gift:true, entity_id:null};
            dispatch(new InfoEvent(EventConstants.SEND_GIFT_REQUEST, null, _local2));
        }
        private function get view():LostPetView{
            return ((viewComponent as LostPetView));
        }

    }
}//package net.wooga.pets.views.popups.lostpet 
